﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ModelLayer.Patients;
using DataAccessLayer.Patients;

namespace BussinesLayer.Patients
{
    public class AgendaPatientController
    {
        public static string currentPID;

        public static string CreateTempPatient(bool vipPatient, string idDocument, string familyName, string givenName, string middleName, string mobileNumber, string phoneNumber, string sex, string birthDate, string email, string patientType)
        {
            TempPatient patient = new TempPatient();
            patient = TempPatient.NewTempPatient(vipPatient, idDocument, familyName, givenName, middleName, mobileNumber, phoneNumber, sex, birthDate, email, patientType, GeneratePID());
            return PatientsDataAccess.InsertNewTempPatient(patient);
        }

        public static string GeneratePID()
        {
            long lastPid = PatientsDataAccess.GetLastPID();
            lastPid++;
            return lastPid.ToString();
        }

        public static string GetPatientsFullNameFromPatientOID(string OID)
        {
            return PatientsDataAccess.GetPatientsFullNameFromPatientOID(OID);
        }

        public static string GetPatientProfileOIDFromPatientOID(string poid)
        {
            return PatientsDataAccess.GetPatientProfileOIDFromPatientOID(poid);
        }

        public static TempPatient GetTempPatient(Guid oid)
        {
            return PatientsDataAccess.GetTempPatient(oid);
        }
    }
}
